﻿using System;
using System.Collections.Generic;

using System.Text;

namespace DoxygenBrowserAddin.Data
{
  public static class Scope
  {
    public static string Normalizate(string strNamespace)
    {
      string strResult = string.Empty;
      string[] astrNamespaceParts = strNamespace.Split('.');
      for(int iIndex=0; iIndex<astrNamespaceParts.Length; iIndex++)
      {
        strResult += astrNamespaceParts[iIndex];
        if(iIndex!=astrNamespaceParts.Length-1)
        {
          strResult += "::";
        }
      }
      return strResult;
    }

    public static string Combine(string strScope1, string strScope2)
    {
      string strResult = string.Empty;
      
      if(!string.IsNullOrEmpty(strScope1) && !string.IsNullOrEmpty(strScope2) )
      {
        strResult = strScope1 + "::" + strScope2;
      }
      else if (!string.IsNullOrEmpty(strScope1))
      {
        strResult = strScope1;
      }
      else if (!string.IsNullOrEmpty(strScope1))
      {
        strResult = strScope2;
      }
      return strResult;
    }

  }
}
